import http from "@/utils/request";
import type { Venue, VenueForm, VenueQueryParams } from "./types";

/**
 * 获取设备分页列表
 *
 * @param queryParams
 */
export const getVenuePage = (queryParams: VenueQueryParams) => {
  return http({
    url: "/api/v1/venue/page",
    method: "get",
    params: queryParams,
    headers: {
      'Content-Type': 'application/json'
    }
  });
}

/**
 * 获取用户表单详情
 *
 * @param id
 */
export const getVenueForm = (id: number) =>{
  return http({
    url: "/api/v1/venue/getVenueForm",
    method: "get",
    params: {id: id},
    headers: {
      'Content-Type': 'application/json'
    }
  });
}

/**
 * 添加用户
 *
 * @param data
 */
export const addVenue = (data: Venue) => {
  return http({
    url: "/api/v1/venue/add",
    method: "post",
    data: data,
    headers: {
      'Content-Type': 'application/json'
    }
  });
}

/**
 * 修改设备信息
 *
 * @param data
 */
export const updateVenue = (data: VenueForm) => {
  return http({
    url: "/api/v1/venue/update",
    method: "put",
    data: data,
    headers: {
      'Content-Type': 'application/json'
    }
  });
}

/**
 * 删除设备信息
 * @param id
 */
export const deleteVenue = (id: number) => {
  return http({
    url: "/api/v1/venue/delete",
    method: "delete",
    data: id,
    headers: {
      'Content-Type': 'application/json'
    }
  });
}
